package lishaole;

import java.util.Scanner;

public class java5d {
public static void main(String[] args){
	Scanner sc=new Scanner(System.in);
	int n=sc.nextInt();
	double[] number=new double[n];
    for(int i=0;i<n;i++)
	number[i]=sc.nextDouble();
    ArrayUtils arr=new ArrayUtils();
    System.out.println(arr.findMinMax(number));
	System.out.println(ArrayUtils.PairResult.class);
}


}


class  ArrayUtils{
	static class PairResult{
		private  double min;
		private double max;
		@Override
		public String toString() {
			return "PairResult [min=" + min + ", max=" + max + "]";
		}
		
	}

		static PairResult  findMinMax(double[] number){
			PairResult lsl=new PairResult();
			double min=number[0],max=number[0];
		for (Double x:number)
		{	 	
		if(min>x) min=x;
		if(max<x) max=x;               
		}
		lsl.max=max;
		lsl.min=min;
		return lsl;
		}

		
	}

	








